home *** CD-ROM | disk | FTP | other *** search
/ CD Ware Multimedia 1995 May / cd Ware (Juegos) Epimundo.iso / DOS / PRGMMING / CPP100.ZIP / CPPLTC1.C < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-22  |  7.2 KB  |  199 lines

  1. /*****************************************************************************/
  2. /*       (C) 1993,1994 R. NADE - M. GRANDCHAMP - All Rights Reserved         */
  3. /*****************************************************************************/
  4. /*    This source-code is NOT public domain nor Freeware, this is part of    */
  5. /*              'The C Programming Package' which is Shareware.              */
  6. /*   If you use this code, please register and get a free Full-VGA version   */
  7. /*****************************************************************************/
  8.                             /*---------------------*
  9.                              *      CPPLTC1.C      *
  10.                              * introduction module *
  11.                              *---------------------*/
  12.  
  13.  # define DURATION 270
  14.  
  15.  /* Included Files */
  16.  # include <stdio.h>
  17.  # include <io.h>
  18.  
  19.  /* Global Variables */
  20.  extern int x,y,z,i,j,k,l,m,n;
  21.  extern unsigned char c1;
  22.  
  23.  
  24.  /*------------------------*
  25.   * DISPLAY OPENING SCREEN *
  26.   *------------------------*/
  27.   void display_opening_screen()
  28.     {
  29.       /* We erase the screen and put the background colour */
  30.       /* We add the program title                          */
  31.       /* We draw the borders to get the initial info.      */
  32.  
  33. /*      setlinestyle(SOLID_LINE,1,3);    rectangle(11,64,213,476);
  34.       rectangle(221,64,423,266);       rectangle(431,64,633,266);
  35.       rectangle(221,274,423,476);      rectangle(431,274,633,476);
  36.       setlinestyle(SOLID_LINE,1,1);    setfillstyle(SOLID_FILL,EGA_LIGHTGRAY);
  37.       bar3d(12,65,212,475,0,0);        bar3d(222,65,422,265,0,0);
  38.       bar3d(432,65,632,265,0,0);       bar3d(222,275,422,475,0,0);
  39.       bar3d(432,275,632,475,0,0); */
  40.       /* We fill up the rectangles */
  41.       /* Left page */
  42. /*      outtextxy(20,75,"      PROGRAMME        ");
  43.       outtextxy(20,85,"     ------------      ");
  44.       outtextxy(20,115,                        ");
  45.       outtextxy(20,135,"                       ");
  46.       outtextxy(20,155,"                       ");
  47.       outtextxy(20,175,"                       ");
  48.       outtextxy(20,195,"                       ");
  49.       outtextxy(20,215,"                       ");
  50.       outtextxy(20,235,"                       ");
  51.       outtextxy(20,255,"                       ");
  52.       outtextxy(20,275,"                       ");
  53.       outtextxy(20,295,"                       ");
  54.       outtextxy(20,315,"                       ");
  55.       outtextxy(20,335,"                       ");
  56.       outtextxy(20,355,"                       ");
  57.       outtextxy(20,375,"                       ");
  58.       outtextxy(20,395,"                       ");
  59.       outtextxy(20,415,"                       ");
  60.       outtextxy(20,435,"                       ");
  61.       outtextxy(20,455,"                       ");  */
  62.       /* up Median page  */
  63. /*      outtextxy(230,75,"     APPLICATION N°1   ");
  64.       outtextxy(230,85,"     ---------------   ");
  65.       outtextxy(230,115,"                       ");
  66.       outtextxy(230,135,"                       ");
  67.       outtextxy(230,155,"                       ");
  68.       outtextxy(230,175,"                       ");
  69.       outtextxy(230,195,"                       ");
  70.       outtextxy(230,215,"                       ");
  71.       outtextxy(230,235,"                       "); */
  72.       /* down median Page */
  73. /*      outtextxy(230,285,"    APPLICATION N°2    ");
  74.       outtextxy(230,295,"    ---------------    ");
  75.       outtextxy(230,325,"                       ");
  76.       outtextxy(230,345,"                       ");
  77.       outtextxy(230,365,"                       ");
  78.       outtextxy(230,385,"                       ");
  79.       outtextxy(230,405,"                       ");
  80.       outtextxy(230,425,"                       ");
  81.       outtextxy(230,445,"                       ");   */
  82.       /* up right page */
  83. /*      outtextxy(440,75,"     APPLICATION N°3   ");
  84.       outtextxy(440,85,"     ---------------   ");
  85.       outtextxy(440,115,"                       ");
  86.       outtextxy(440,135,"                       ");
  87.       outtextxy(440,155,"                       ");
  88.       outtextxy(440,175,"                       ");
  89.       outtextxy(440,195,"                       ");
  90.       outtextxy(440,215,"                       ");
  91.       outtextxy(440,235,"                       "); */
  92.       /* down right page */
  93. /*      outtextxy(440,285,"    APPLICATION N°4    ");
  94.       outtextxy(440,295,"    ---------------    ");
  95.       outtextxy(440,325,"                       ");
  96.       outtextxy(440,345,"                       ");
  97.       outtextxy(440,365,"                       ");
  98.       outtextxy(440,385,"                       ");
  99.       outtextxy(440,405,"                       ");
  100.       outtextxy(440,425,"                       ");
  101.       outtextxy(440,445,"                       ");   */
  102.     }
  103.  /*------------------*
  104.   * VIVALDI'S SPRING *
  105.   *------------------*/
  106.   void vivaldi_s_spring()
  107.     {
  108.       int list1[7]={220,277,277,247,220,330,330};
  109.       int list2[7]={220,277,277,247,220,330,330};
  110.       int list3[9]={330,294,277,294,330,294,277,247,247};
  111.       int list4[7]={220,277,277,247,220,330,330};
  112.       int list5[7]={220,277,277,247,220,330,330};
  113.       int list6[8]={330,294,277,294,330,294,277,247};
  114.       int list7[9]={220,330,294,277,294,330,370,330,330};
  115.       int list8[9]={220,330,294,277,294,330,370,330,330};
  116.       int list9[10]={277,370,294,277,247,220,247,220,220,220};
  117.  
  118.       while(1){
  119.         /* notes list for the introduction music */
  120.     /* n° 1  */
  121.     if(kbhit()!=0){
  122.       c1=getch();                  return;
  123.     }
  124.         /* If we pressed a key to stop the introduction */
  125.         /* we return to the main program                */
  126.     for(i=0; i<7; i++){
  127.           sound(list1[i]);            delay(DURATION);
  128.     }
  129.         nosound();
  130.     /* n° 2 */
  131.     if(kbhit()!=0){
  132.       c1=getch();                  return;
  133.     }
  134.     for(i=0; i<7; i++){
  135.           sound(list2[i]);            delay(DURATION);
  136.     }
  137.         nosound();
  138.     /* n° 3 */
  139.     if(kbhit()!=0){
  140.       c1=getch();                  return;
  141.     }
  142.     for(i=0; i<9; i++){
  143.           sound(list3[i]);            delay(DURATION);
  144.     }
  145.         nosound();
  146.     /* n° 4 */
  147.     if(kbhit()!=0){
  148.       c1=getch();                  return;
  149.     }
  150.     for(i=0; i<7; i++){
  151.           sound(list4[i]);            delay(DURATION);
  152.     }
  153.         nosound();
  154.     /* n° 5 */
  155.     if(kbhit()!=0){
  156.       c1=getch();                  return;
  157.     }
  158.     for(i=0; i<7; i++){
  159.           sound(list5[i]);            delay(DURATION);
  160.     }
  161.         nosound();
  162.     /* n° 6 */
  163.     if (kbhit()!=0){
  164.       c1=getch();                  return;
  165.     }
  166.     for(i=0; i<8; i++){
  167.           sound(list6[i]);            delay (DURATION);
  168.     }
  169.         nosound();
  170.     /* n° 7 */
  171.     if(kbhit()!=0){
  172.       c1=getch();                  return;
  173.     }
  174.     for(i=0; i<9; i++){
  175.           sound(list7[i]);            delay(DURATION);
  176.     }
  177.         nosound();
  178.     /* n° 8  */
  179.     if(kbhit()!=0){
  180.       c1=getch();                  return;
  181.     }
  182.     for(i=0; i<9; i++){
  183.           sound(list8[i]);            delay(DURATION);
  184.     }
  185.         nosound();
  186.     /* n° 9 */
  187.     if (kbhit()!=0){
  188.       c1=getch();                  return;
  189.     }
  190.     for(i=0; i<10; i++){
  191.           sound(list9[i]);            delay (DURATION);
  192.     }
  193.         nosound();
  194.       }
  195.     }
  196.  /*----------------*
  197.   * End of program *
  198.   *----------------*/ /*-----------------------*/
  199.